﻿using System;
using NCMIS.AccessControl;
using NCMIS.ObjectModel;
using NCMIS.ObjectModel.MetaData;
using NCMIS.Produce;
using NCMIS.Provider;

namespace NCMIS.Provider.SampleProvider
{
    public class SampleVersioningProvider : VersioningProviderBase
    {
        public override CopyFlaggedDocumentId CheckOut(string repositoryId, string documentId)
        {
            return SampleFactory.CreateCopyFlaggedDocumentId();
        }

        public override void CancelCheckOut(string repositoryId, string documentId)
        {
            return;
        }

        public override string CheckIn(string repositoryId, string documentId, bool? major, CmisProperties properties, ContentStream contentStream, string checkinComment, string[] policies, AccessControlList addACEs, AccessControlList removeACEs)
        {
            return "Document 17";
        }

        public override CmisObject GetObjectOfLatestVersion(string repositoryId, string objectId, bool major, string filter, bool includeAllowableActions, IncludeRelationships includeRelationships, string renditionFilter, bool includePolicyIds, bool includeAcl)
        {
            return SampleFactory.CreateCmisObject();
        }

        public override CmisProperties GetPropertiesOfLatestVersion(string repositoryId, string objectId, bool major, string filter)
        {
            return SampleFactory.CreateCmisProperties();
        }

        public override CmisObject[] GetAllVersions(string repositoryId, string objectId, string filter, bool includeAllowableActions)
        {
            return new CmisObject[] { SampleFactory.CreateCmisObject() };
        }
    }
}